Fix bug#6820: Don't accept backslashes or quotes on compiler options.
authorJuanma Barranquero <lekktu@gmail.com>
Wed, 22 Sep 2010 23:14:00 +0000 (01:14 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 22 Sep 2010 23:14:00 +0000 (01:14 +0200)
* nt/configure.bat: Err out when the argument of --cflags contains
  invalid characters (check implemented only for GCC).

nt/ChangeLog
nt/configure.bat

index 11e95205a55d891b0fa5740eac7bb579389b4ae6..83001c58e9ad705fbb14deb30286867ea88f834b 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-22  Juanma Barranquero  <lekktu@gmail.com>
+
+       * configure.bat: Err out when the argument of --cflags contains
+       invalid characters (check implemented only for GCC).  (Bug#6820)
+
 2010-08-19  Juanma Barranquero  <lekktu@gmail.com>
 
        * addpm.c (add_registry): Create App Paths of type REG_EXPAND_SZ.
index fc9fae4da60a216e6428bc8d2758073ef334af31..4866c9fcad5532617ba33e062b585bd94d237f76 100755 (executable)
@@ -358,9 +358,25 @@ gcc %cf% -c junk.c
 @echo gcc %cf% -c junk.c >>config.log\r
 gcc %cf% -c junk.c >>config.log 2>&1\r
 set cf=\r
-if exist junk.o goto gccOk\r
+if exist junk.o goto chkuser\r
 echo The failed program was: >>config.log\r
 type junk.c >>config.log\r
+goto nocompiler\r
+\r
+:chkuser\r
+rm -f junk.o\r
+echo int main (int argc, char *argv[]) {>junk.c\r
+echo char *usercflags = "%usercflags%";>>junk.c\r
+echo }>>junk.c\r
+echo gcc -Werror -c junk.c >>config.log\r
+gcc -Werror -c junk.c >>config.log 2>&1\r
+if exist junk.o goto gccOk\r
+echo.\r
+echo Error in --cflags argument: %usercflags%\r
+echo Backslashes and quotes cannot be used with --cflags.  Please use forward\r
+echo slashes for filenames and paths (e.g. when passing directories to -I).\r
+rm -f junk.c\r
+goto end\r
 \r
 :nocompiler\r
 echo.\r